﻿#ifndef PJZCALC_H
#define PJZCALC_H

#include <QDialog>
#include <QMessageBox>
#include <QString>
#include <QFile>
#include <QJsonObject>
#include <QJsonDocument>

#define CFG_FILE "../etc/preset/pjz_calc.json"

namespace Ui {
class PjzCalc;
}

class PjzCalc : public QDialog
{
    Q_OBJECT

public:
    explicit PjzCalc(QWidget *parent = 0);
    ~PjzCalc();

    bool load(const QString &fileName=CFG_FILE);
    bool save(const QString &fileName=CFG_FILE);
    void genSummary(double result);
    void genSummary(double inradius,double exradius);

private slots:
    void on_btn_calc_clicked();

    void on_btn_save_clicked();

private:
    Ui::PjzCalc *ui;

    double radius_2k;
    double radius_4k;
    double radius_4c;

    double kq_inradius;
    double kq_exradius;

    double ct_inradius;
    double ct_exradius;

    int _num;
    double _result;
    double _inradius;
    double _exradius;

    QString _summary;
};

#endif // PJZCALC_H
